<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div id="app">
        <hello></hello>
    </div>

    <div id="app2">
        <hello/>
    </div>

    <script src="js/vue.js"></script>
    <script>
        Vue.component("hello",{
            template:`
            <div>
                <h3>hello!!!{{msg}}</h3>
                <button @click="addMsg">点击+1</button>
            </div>
            `,
            data(){
                return{
                    msg:1
                }
            },
            methods:{
                addMsg(){
                    this.msg++
                }
            }
        })

        new Vue({
            el:"#app",
        })

        new Vue({
            el:"#app2",
        })

    </script>
</body>
</html>